package com.company.sendemo.basics.zzInterview.select;

public class Four {
    public int x ;
    public static void main(String[] args) {
        StringBuffer a = new StringBuffer("A");
        StringBuffer b = new StringBuffer("B");
        operator(a,b);

        String hello = new String("Hello"); //TODO
        String hello1= "Hello"; //存储常量池
        if (hello=="Hello"){
            System.out.println("hello1:"+(hello=="Hello"));
        }else {
            System.out.println("hello1:"+(hello=="Hello"));
        }

        if (hello1=="Hello"){
            System.out.println("hello1:"+(hello1=="Hello"));
        }else {
            System.out.println("hello1:"+(hello1=="Hello"));
        }

        String ss = "1234";
        change(ss);
        System.out.println("ss1"+ss);
//        System.out.println("Value is"+ x);  非静态变量不能被静态方法引用
    }
    public static void operator(StringBuffer x, StringBuffer y){
        x.append(y);
        System.out.println(x);
        System.out.println(y);
        y = x;
        System.out.println(x+","+y);
    }
    public static void change(String ss){
        ss="welcome";
        System.out.println("ss2"+ss);
    }
}
